package org.esky.spring.ioc;


import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Simple {
	private static final Log LOG = LogFactory.getLog(Simple.class);
	
	private String name;
	private Date date;
	private int age;
	private List<?> list;
	private Map<?, ?> map;
	private Set<?> set;
	private String[] array;
	private Properties properties;
	private SimpleRef simpleRef;
	
	//
	public Simple() {
		LOG.info("whitout parameter.");
	}
	
	public Simple(String name, Date date) {
		this.name = name;
		this.date = date;
		LOG.info("name = " + name + "\t date = " + date);
	}
	
	public Simple(Date date) {
		this.date = date;
		LOG.info("date = " + date);
	}
	
	public Simple(String name, int age) {
		this.name = name;
		this.age = age;
		LOG.info("name = " + name + "\t age = " + age);
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public List<?> getList() {
		return list;
	}
	public void setList(List<?> list) {
		this.list = list;
	}
	public Map<?, ?> getMap() {
		return map;
	}
	public void setMap(Map<?, ?> map) {
		this.map = map;
	}
	public Set<?> getSet() {
		return set;
	}
	public void setSet(Set<?> set) {
		this.set = set;
	}
	public String[] getArray() {
		return array;
	}
	public void setArray(String[] array) {
		this.array = array;
	}
	public SimpleRef getSimpleRef() {
		return simpleRef;
	}
	public void setSimpleRef(SimpleRef simpleRef) {
		this.simpleRef = simpleRef;
	}
	public Properties getProperties() {
		return properties;
	}
	public void setProperties(Properties properties) {
		this.properties = properties;
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("name = " + name + "\t");
		sb.append("date = " + date + "\t");
		sb.append("age = " + age + "\n");
		sb.append("list = ");
		for (int i = 0; i < list.size(); i++) {
			sb.append(list.get(i) + "\t");
		}
		sb.append("map = " + map + "\t");
		sb.append("set = " + set + "\t");
		sb.append("array = " + array + "\t");
		return sb.toString();
	}
}
